package com.yanqu.road.server.cmd.activity.selectlottery;

import com.yanqu.road.exception.BusinessException;
import com.yanqu.road.message.YanQuMessage;
import com.yanqu.road.pb.activity.ApprenticeProto;
import com.yanqu.road.pb.activity.SelectLotteryProto;
import com.yanqu.road.server.cmd.CrossCommand;
import com.yanqu.road.server.command.Cmd;
import com.yanqu.road.server.logic.MessageHelper;
import com.yanqu.road.server.manager.activity.apprentice.CrossApprenticeActivity;
import com.yanqu.road.server.manager.activity.apprentice.CrossApprenticeMgr;
import com.yanqu.road.server.manager.activity.selectlottery.CrossSelectLotteryActivity;
import com.yanqu.road.server.manager.activity.selectlottery.CrossSelectLotteryMgr;
import com.yanqu.road.server.protocol.Protocol;
import com.yanqu.road.utils.YanQuMessageUtils;

@Cmd(code = Protocol.C2_SELECT_LOTTERY_ADD_NOTICE, desc = "通用自选抽奖-添加公告")
public class CrossSelectLotteryAddNoticeCmd extends CrossCommand {


    @Override
    public boolean parseData(YanQuMessage packet) throws Exception {
        return true;
    }

    @Override
    public void execute(YanQuMessage packet) throws Exception {
        SelectLotteryProto.SelectLotteryNoticeData reqMsg = SelectLotteryProto.SelectLotteryNoticeData.parseFrom(packet.getBytes());
        CrossSelectLotteryActivity activity = CrossSelectLotteryMgr.getActivity(reqMsg.getActivityId());
        if (activity == null) {
            return;
        }
        activity.addNotice(packet.getPlayerId(), reqMsg.getServerId(), reqMsg.getRewardId(), reqMsg.getNickname(), reqMsg.getTime());
    }

    @Override
    public void sendData() {

    }
}
